/**
 * 
 */
package ee.logsimulator.data;

import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;

/**
 * @author Romet Piho
 */
public class Actor {

  private String name;
  private String id;
	private String hash;
  private String actorClass;

	public Actor(String hash, String id, String name, String clazz) {
		this.hash = hash;
		this.id = id;
    this.name = name;
		this.actorClass = clazz;
  }

  public String getName() {
    return name;
  }

  public void setName(String name) {
    this.name = name;
  }

  public String getActorClass() {
    return actorClass;
  }

  public void setActorClass(String actorClass) {
    this.actorClass = actorClass;
  }

	public String getHash() {
		return hash;
	}

	public void setHash(String hash) {
		this.hash = hash;
	}


  public boolean isPlayerClass() {
		return Clazz.fromName(actorClass).isPlayer();
  }

  public String getId() {
    return id;
  }

  public void setId(String id) {
    this.id = id;
  }

  @Override
  public boolean equals(Object obj) {
    return EqualsBuilder.reflectionEquals(this, obj);
  }

  @Override
  public int hashCode() {
    return HashCodeBuilder.reflectionHashCode(this);
  }

  @Override
  public String toString() {
    return id + " " + name;
  }
}
